const path = require("path");
const { merge } = require("webpack-merge");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { HotModuleReplacementPlugin } = require("webpack");
const webpack = require("webpack");
// const path = require("path");
const { VueLoaderPlugin } = require("vue-loader");
// const HtmlWebpackPlugin = require("html-webpack-plugin");
const packageConfigs = require("./package.json");
const common = require("./webpack.common");

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map",
  // output: {
  //   filename: "[name].bundle.js",
  // },
  target: "web",
  devServer: {
    contentBase: path.resolve(__dirname, "public"),
    watchContentBase: true,
    open: true,
    hot: true,
    // after: function(app, server, compiler) {
    //   // 默认webpack Log中访问地址不明显，下面操作后突出提示url
    //   compiler.hooks.done.tap("serveNote", function(status) {
    //     setTimeout(() => {
    //       console.clear();
    //       console.log("\x1B[32m \n \n \t \t编译结束。\x1B[0m");
    //       console.log(
    //         `\x1B[32m \t \t请前往[ http://${server.options.host}:${server.options.port} ]\n \n\x1B[0m`
    //       );
    //     }, 200);
    //   });
    // },
  },
});
